package cn.smbms.pojo;


import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;


//import org.hibernate.validator.constraints.NotEmpty;
//import org.springframework.format.annotation.DateTimeFormat;


/**
 * 用户类
 * @author John
 *
 */
public class User {
	private  Integer id;
	
	/*@NotEmpty(message="账号不能为空")*/
	private  String userCode;
	private  String  userName;

	/*@NotEmpty(message="密码不能为空")*/
	String userPassword;
	private  int gender;
	
	@DateTimeFormat(pattern="yyyy-MM-dd")
	private  Date birthday;
	
	private  String phone;
	private  String address;
	private  Integer userRole;
	private  int createdBy;
	
	/*@JSONField(format="yyyy-MM-dd")*/
	private  Date creationDate;
	private  int modifyBy;
	private  Date modifyDate;
	
	private String idPicPath;
	
	private String roleName;
	private String imgPath;
	
	public String getRoleName() {
		return roleName;
	}


	public String getImgPath() {
		return imgPath;
	}


	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}


	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	private Integer age;//年龄
	
	
	public Integer getAge() {
		Date date = new Date();
		Integer age = date.getYear()-birthday.getYear();
		return age;
	}
	
	public void setAge(Integer age) {
		this.age = age;
	}


	public String getUserCode() {
		return userCode;
	}
	public String getIdPicPath() {
		return idPicPath;
	}
	public void setIdPicPath(String idPicPath) {
		this.idPicPath = idPicPath;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getUserPassword() {
		return userPassword;
	}
	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}
	public int getGender() {
		return gender;
	}
	public void setGender(int gender) {
		this.gender = gender;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	
	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public Integer getUserRole() {
		return userRole;
	}
	public void setUserRole(Integer userRole) {
		this.userRole = userRole;
	}
	public int getCreatedBy() {
		return createdBy;
	}
	public void setCreatedBy(int createdBy) {
		this.createdBy = createdBy;
	}
	public Date getCreationDate() {
		return creationDate;
	}
	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}
	public int getModifyBy() {
		return modifyBy;
	}
	public void setModifyBy(int modifyBy) {
		this.modifyBy = modifyBy;
	}
	public Date getModifyDate() {
		return modifyDate;
	}
	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}
	

	
}
